<?php $__env->startSection('content'); ?>
    <div class="admin-content">

        <div class="am-cf am-padding">
            <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">自定义菜单</strong> /
                <small>Customer Menus</small>
            </div>
        </div>
        <br/>
        <?php echo $__env->make('admin.layouts._flash', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

        <div class="am-g">
            <div class="am-u-sm-12 am-u-md-6">
                <div class="am-btn-toolbar">
                    <div class="am-btn-group am-btn-group-xs">
                        <a href="/shop/wechat/destroy" class="am-btn am-btn-secondary" id="destroy_checked" data-method="delete" data-token="<?php echo e(csrf_token()); ?>" data-confirm="确认删除菜单吗?此操作不可恢复!">
                            <span class="am-icon-trash-o"></span> 删除菜单
                        </a>
                    </div>
                </div>
            </div>

            <div class="am-u-sm-12 am-u-md-12">

                <div class="am-tab-panel">

                    <form class="am-form " action="/shop/wechat/update" method="post">

                        <?php echo csrf_field(); ?>

                        <?php echo method_field('put'); ?>


                        <div class="am-tabs" data-am-tabs="" style="margin:1.6rem 0;">
                            <ul class="am-tabs-nav am-nav am-nav-tabs">
                                <li class="am-active"><a href="#tab0">菜单一</a></li>
                                <li><a href="#tab1">菜单二</a></li>
                                <li><a href="#tab2">菜单三</a></li>
                            </ul>

                            <div class="am-tabs-bd" style="touch-action: pan-y; -webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);">
                                <?php for($i=0;$i<3;$i++): ?>
                                    <?php
                                    $button = isset($buttons["$i"]) ? $buttons["$i"] : "";
                                        var_dump($button);
                                    ?>
                                <div class="am-tab-panel am-fade   <?php if($i==0): ?> am-in am-active  <?php endif; ?>  " id="tab<?php echo e($i); ?>">
                                    <table class="am-table am-table-hover">
                                        <thead>
                                        <tr>
                                            <th>级别</th>
                                            <th>类型</th>
                                            <th>名称</th>
                                            <th>值</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr>
                                            <td>一级菜单：</td>
                                            <td>
                                                <select class="form-control am-form-field am-radius type" name="buttons[<?php echo e($i); ?>][type]">
                                                    <option value="click" <?php if(isset($button["type"]) and $button["type"] == 'click'): ?> selected <?php endif; ?>>
                                                        click
                                                    </option>

                                                    <option value="view"  <?php if(isset($button["type"]) and $button["type"] == 'view'): ?> selected <?php endif; ?>>
                                                        view
                                                    </option>
                                                </select>
                                            </td>
                                            <td>
                                                <input type="text" name="buttons[<?php echo e($i); ?>][name]" value="<?php echo e(isset($button['name']) ? $button['name'] : ''); ?>" class="am-form-field am-radius">
                                            </td>
                                            <td>
                                                <input type="text" name="buttons[<?php echo e($i); ?>][value]"
                                                       <?php if(isset($button["key"])): ?>
                                                       value="<?php echo e($button["key"]); ?>"
                                                       <?php elseif(isset($button["url"])): ?>
                                                       value="<?php echo e($button["url"]); ?>"
                                                       <?php else: ?>
                                                       value=""
                                                       <?php endif; ?>
                                                       class="am-form-field am-radius">
                                            </td>
                                        </tr>

                                    <?php for($j=0;$j<5;$j++): ?>

                                        <tr>
                                            <td>二级菜单：<?php echo e($j+1); ?></td>

                                            <td>
                                                <select class="form-control am-form-field am-radius type" name="buttons[<?php echo e($i); ?>][sub_button][<?php echo e($j); ?>][type]">
                                                    <option value="click" <?php if(isset($button['sub_button']["$j"]["type"]) and $button['sub_button']["$j"]["type"]== 'click'): ?> selected <?php endif; ?>>
                                                        click
                                                    </option>

                                                    <option value="view" <?php if(isset($button['sub_button']["$j"]["type"]) and $button['sub_button']["$j"]["type"] == 'view'): ?> selected <?php endif; ?>>
                                                        view
                                                    </option>
                                                </select>
                                            </td>
                                            <td>
                                                <input type="text" name="buttons[<?php echo e($i); ?>][sub_button][<?php echo e($j); ?>][name]"
                                                       value="<?php echo e(isset($button['sub_button']["$j"]['name']) ? $button['sub_button']["$j"]['name'] : ''); ?>"
                                                       class="am-form-field am-radius">
                                            </td>
                                            <td>
                                                <input type="text" name="buttons[<?php echo e($i); ?>][sub_button][<?php echo e($j); ?>][value]"
                                                       <?php if(isset($button['sub_button']["$j"]["key"])): ?>
                                                       value="<?php echo e($button['sub_button']["$j"]["key"]); ?>"
                                                       <?php elseif(isset($button['sub_button']["$j"]["url"])): ?>
                                                       value="<?php echo e($button['sub_button']["$j"]["url"]); ?>"
                                                       <?php else: ?>
                                                       value=""
                                                       <?php endif; ?>

                                                       class="am-form-field am-radius">
                                            </td>
                                        </tr>

                                        <?php endfor; ?>
                                        </tbody>
                                    </table>
                                </div>
                                <?php endfor; ?>
                            </div>
                        </div>

                        <div class="am-margin">
                            <button type="submit" class="am-btn am-btn-primary">保存修改</button>
                        </div>

                    </form>
                </div>
            </div>
        </div>
    </div>
    <?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>